@import './colors';
@import './mixins/mixins';
@import './buttons';

.tasks,
.task,
.task-title,
.task-bd,
.task-ft,
.task-deadline,
.task-deadline-text,
.task-estimate-text,
.task-button {
  margin: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.task-level,
.task-estimate,
.task-estimate-icon,
.task-deadline-icon,
.task-side {
  overflow: hidden;
  position: absolute;
  z-index: 2;
}

.tasks {
  box-sizing: border-box;
  height: 100%;
  overflow: auto;
  padding: 10px 0;
}

.task {
  background-color: $white;
  border: 1px solid $border-color;
  border-left-width: 3px;
  margin: -1px 10px 0;
  padding: 0;
  user-select: none;

  &:hover {
    cursor: move;
    z-index: 2;

    .task-side {
      left: 0;
    }

    .task-main {
      margin-left: 26px;
    }
  }
}

.task-main {
  overflow: hidden;
  position: relative;
  transition: .3s;
  z-index: 1;
}

.task-hd {
  height: 40px;
  line-height: 40px;
  width: 100%;
}

.task-title {
  font-size: 14px;
  font-weight: normal;
  height: 40px;
  line-height: 40px;
  margin: 0 40px 0 10px;
  text-overflow: ellipsis;
  user-select: none;
  white-space: nowrap;
}

.task-title-text {
  color: $primary;
  cursor: pointer;
  font-weight: normal;

  &:hover {
    text-decoration: underline;
  }
}

.task-level {
  @include radius(10px);
  right: 0;
  top: 0;
}

.task-level-0 {
  @include button(40px, 40px, 16px, $red, $red);
}

.task-level-1 {
  @include button(40px, 40px, 16px, $pink, $pink);
}

.task-level-2 {
  @include button(40px, 40px, 16px, $blue, $blue);
}

.task-level-3 {
  @include button(40px, 40px, 16px, $green, $green);
}

.task-bd {
  margin: 0 10px;
  padding-bottom: 10px;
}

.task-desc {
  color: $theme-secondary-text;
  font-size: 12px;
  font-weight: normal;
  line-height: 18px;
  margin: 0 auto;
  max-height: 36px;
  overflow: hidden;

  ul,
  li {
    list-style-type: none;
  }

  dt,
  dd,
  li {
    margin: 0;
    padding: 0;
  }

  p,
  ul,
  li,
  dt,
  dd {
    line-height: 18px;
  }
}

.task-ft {
  border-top: 1px solid $border-color;
  color: $theme-secondary-text;
  font-size: 12px;
  height: 30px;
  line-height: 30px;
  margin: 0 10px;
}

.task-deadline {
  height: 30px;
  line-height: 30px;
  margin: 0 50px 0 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-deadline-icon,
.task-estimate-icon {
  @include button(20px, 30px, 12px, $theme-secondary-text, $theme-secondary-text);
  left: 0;
  top: 0;
}

.task-estimate-text,
.task-deadline-text {
  margin: 0 0 0 20px;
}

.task-estimate {
  height: 30px;
  margin: 0;
  right: 0;
  top: 0;
  width: 50px;
}

.task-side {
  height: 100%;
  left: -27px;
  top: 0;
  transition: .3s;
  width: 24px;
}

.task-button {
  @include button(26px, 26px, 13px);
  cursor: pointer;
}

.task-prev,
.task-replace,
.task-next {
  display: none;
}

.task-delete {
  @include button(26px, 26px, 13px, $light-gray, $pink);
}

.task-marked {
  border-left-color: $primary;

  &:hover {
    border-color: $primary;
  }

  .task-title {
    color: $primary;
  }

  .icon-bookmark {
    color: $primary;
  }
}

.task-delayed {
  border-left-color: $orange;

  &:hover {
    border-color: $orange;
  }
}

.task-deleted {
  .task-prev {
    display: none;
  }

  .task-edit {
    display: none;
  }

  .task-bookmark {
    display: none;
  }

  .task-replace {
    display: block;
  }

  .task-next {
    display: none;
  }
}

.task-status-0 {
  .task-prev {
    display: none;
  }
}

.task-status-3 {
  .task-next {
    display: none;
  }
}
